package com.example.bookshelf.data;

import android.os.Parcel;
import android.os.Parcelable;

import androidx.annotation.NonNull;

import java.io.Serializable;

public class BookLabel implements Parcelable, Serializable {
    private String label;

    public BookLabel(String label) {
        this.label = label;
    }

    @NonNull
    @Override
    public String toString(){
        return label;
    }


    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }


    protected BookLabel(Parcel in) {
        label = in.readString();
    }

    public static final Creator<BookLabel> CREATOR = new Creator<BookLabel>() {
        @Override
        public BookLabel createFromParcel(Parcel in) {
            return new BookLabel(in);
        }

        @Override
        public BookLabel[] newArray(int size) {
            return new BookLabel[size];
        }
    };



    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(label);
    }
}
